package Obj;

import Main.GameBegin;

import java.awt.*;

public class BulletsObj extends GameObj{
    public BulletsObj() {
    }

    public BulletsObj(Image img, int width, int height, int x, int y, double speed, GameBegin gameBegin) {
        super(img, width, height, x, y, speed, gameBegin);
    }

    public BulletsObj(Image img, int width, int height, int x, int y, double speed) {
        super(img, width, height, x, y, speed);
    }

    @Override
    public void paintSelf(Graphics g) {
        //更新Y坐标
        //实现子弹移动
        this.y -= speed;
        if (img != null) {
            g.drawImage(img, x, y, width, height, null);
        }

    }

    @Override
    public Rectangle getRec() {
        return super.getRec();
    }
}
